class Lifecycle {

	//或从后台进入前台显示
	static onShow(option = null) {
		// #ifdef MP-WEIXIN
		this.initWechatData(option)
		// #endif
		// #ifdef MP-ALIPAY
		this.initAlipayData(option)
		// #endif
	}

	//从前台进入后台
	static onHide() {
		uni.setStorageSync("query", {})
	}

	static initWechatData(option) {
		if (!option || !option.referrerInfo || !option.referrerInfo.extraData) {
			return
		}
		uni.setStorageSync("query", option.referrerInfo.extraData)
	}

	static initAlipayData(option) {
		if (!option || !option.query) {
			return
		}
		uni.setStorageSync("query", option.query)
	}
}


export default Lifecycle